package com.exercise02_1;

public class TestDemo {
    public static void vehicleRun(Vehicle v){
        System.out.println(v.descRun());
    }
    public static void vehicleGps(Vehicle v){
        System.out.println(v.descGps());
    }
    public static void main(String[] args) {
        CarBenz carBenz = new CarBenz();
        carBenz.price = 500000;
        carBenz.brand = "奔驰";
        vehicleRun(carBenz);

        CarBMW carBMW = new CarBMW();
        carBMW.price = 800000;
        carBMW.brand = "宝马";
        vehicleRun(carBMW);
        vehicleGps(carBMW);

        MotorYMH motorYMH = new MotorYMH();
        motorYMH.price = 50000;
        motorYMH.brand = "雅马哈";
        vehicleRun(motorYMH);

        MotorBMW motorBMW = new MotorBMW();
        motorBMW.price = 80000;
        motorBMW.brand = "宝马";
        vehicleRun(motorBMW);
        vehicleGps(motorBMW);
    }
}
